﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinFormsApp1
{
    /// <summary>
    /// 实体对外命名信息
    /// </summary>
    public class EntityNaming
    {
        public string ColumnName;
        public string Prefix;
        public string Postfix;

        public EntityNaming() { }
        public EntityNaming(string v)
        {
            if (v.IndexOf("#") < 0)
            {
                ColumnName = v;
            }
            else
            {
                var rs = v.Split('#');

                Prefix = rs.Length > 0 ? rs[0] : "";
                ColumnName = rs.Length > 1 ? rs[1] : "";
                Postfix = rs.Length > 2 ? rs[2] : "";
            }
        }

        public override string ToString()
        {
            return Prefix + "#" + ColumnName + "#" + Postfix;
        }
    }
}
